home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / yerk / mps231ss.hqx / Mops source / Asm Source / loadAcodes < prev    next >
Text File  |  1992-09-11  |  2KB  |  81 lines

  1. \ Asm Codes Loader              Reese Warner                  3/85
  2. \  9/11/85 RW Added type26
  3.  
  4.  
  5.   32    hashDic    CODES        $ 1F setMask: codes  8000 allot: codes
  6.  
  7.     type1    TEMPOBJ        \ The class will be changed as necessary
  8.  
  9.  
  10. : BUILDCODES  { \ bytecode type objaddr ct -- }
  11.     0 -> ct
  12.     (Frefill) drop
  13.     BEGIN
  14.         Mword count  put: token        \ gets opcode name
  15.         binary  intrp1 -> bytecode    \ gets bits for opcode
  16.         decimal intrp1 -> type        \ gets type of operation
  17. \ bytecode .h  space type .h  space  print: token  cr    \ debugging
  18.         type
  19.         SELECT{
  20.              1 is{ ['] type1    }end
  21.              2 is{ ['] type2    }end
  22.              3 is{ ['] type3    }end
  23.              4 is{ ['] type4    }end
  24.              5 is{ ['] type5    }end
  25.              6 is{ ['] type6    }end
  26.              7 is{ ['] type7    }end
  27.              8 is{ ['] type8    }end
  28.              9 is{ ['] type9    }end
  29.             10 is{ ['] type10    }end
  30.             11 is{ ['] type11    }end
  31.             12 is{ ['] type12    }end
  32.             13 is{ ['] type13    }end
  33.             14 is{ ['] type14    }end
  34.             15 is{ ['] type15    }end
  35.             16 is{ ['] type16    }end
  36.             18 is{ ['] type18    }end
  37.             19 is{ ['] type19    }end
  38.             20 is{ ['] type20    }end
  39.             21 is{ ['] type21    }end
  40.             22 is{ ['] type22    }end
  41.             23 is{ ['] type23    }end
  42.             24 is{ ['] type24    }end
  43.             26 is{ ['] type26    }end
  44.             27 is{ ['] type27    }end
  45.             28 is{ ['] type28    }end
  46.             29 is{ ['] type29    }end
  47.             30 is{ ['] FPmonadic    }end
  48.             31 is{ ['] FPdyadic    }end
  49.             32 is{ ['] FMOVE    }end
  50.             33 is{ ['] FMOVEM    }end
  51.             34 is{ ['] FBcc    }end
  52.             35 is{ ['] FDBcc    }end
  53.             36 is{ ['] FScc    }end
  54.             37 is{ ['] FTRAPcc    }end
  55.             38 is{ ['] FMOVECR    }end
  56.             39 is{ ['] FNOP    }end
  57.             40 is{ ['] FSINCOS    }end
  58.  
  59.             DEFAULT{ abort
  60.  
  61.         }SELECT
  62.  
  63.         tempObj  set_object_class
  64.         bytecode  init: tempObj        \ reads rest of input line
  65.         tempObj token  enter: codes
  66.         0= abort" hash collision reading asm codes!!"
  67.         (Frefill)
  68.     NUNTIL  ;
  69.  
  70.  
  71. : LOADCODES  { addr len \ svQuery -- }
  72.     cr ." Loading asm codes"
  73.     pushNew: loadfile
  74.     addr len  name: topFile     0 setVref: topFile
  75.     openReadOnly: topFile        \ open "operands"
  76.     IF  200 asmError  THEN
  77.     buildCodes
  78.     drop: loadfile
  79.     pos: codes  strt: codes  -
  80.     cr ." Size of codes dictionary: " .  ;
  81.